#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/mman.h>

char filename[] = "gpio_c0007"; 
int length = 10; 

int main(int argc, char **argv) 
{ 
	int fd; 
	char *p_map; 
	fd = open(filename, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR); 
	lseek(fd, length+1, SEEK_SET); 
	write(fd, "", 1); 
	lseek(fd, 0, SEEK_SET); 
	p_map = mmap(NULL, length, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); 
	close(fd); 
	(*p_map) = 0x11; 
	munmap(p_map, length); 
	printf("umap ok "); 

	return 0;
} 
